'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.WorkLocation = {
    type: Schema.ObjectId,
    ref: 'WorkLocation',
    Name: '工位',
    IsEmpty: false
};

modelField.Work = {
    type: Schema.ObjectId,
    ref: 'Work',
    Name: '作业',
    IsEmpty: false
};

var newModel = new Model(modelField);
newModel.addIndex({WorkLocation: 1});
newModel.addIndex({WorkLocation: 1, Work: 1}, {"unique": true});
newModel.create('StationWork', '工位作业绑定');
